//
//  UMPTouch.m
//  UMPDemo
//
//  Created by Jonathan Diehl on 19.01.09.
//  Copyright 2009 Media Computing Group. All rights reserved.
//

#import "UMPTouch.h"


@implementation UMPTouch

@synthesize pressure, point;
@synthesize previousPressure, previousPoint;

// constructor
- (id)initWithPoint:(NSPoint)aPoint pressure:(CGFloat)aPressure;
{
	self = [super init];
	if (self != nil) {
		point = aPoint;
		pressure = aPressure;
	}
	return self;
}

// update
- (id)updateWithPoint:(NSPoint)aPoint pressure:(CGFloat)aPressure;
{
	self.previousPoint = point;
	self.previousPressure = pressure;
	self.point = aPoint;
	self.pressure = aPressure;
	return self;
}


// x accessor
- (CGFloat)x;
{
	return point.x;
}

// y accessor
- (CGFloat)y;
{
	return point.y;
}

// debug description
- (NSString *)description;
{
	return [NSString stringWithFormat:@"x:%.2f y:%.2f p:%.2f", point.x, point.y, pressure];
}

@end
